package com.ostrich.cloud.ostrichBusinessWeb.service.imp;

import cn.hutool.core.bean.BeanUtil;
import com.ostrich.cloud.common.result.Result;
import com.ostrich.cloud.ostrichBusinessWeb.service.DelivervService;
import com.ostrich.cloud.ostrichBusinessWeb.service.param.StartDeliveryParam;
import com.ostrich.cloud.ostrichDistributionService.client.DeliveryOrderClient;
import com.ostrich.cloud.ostrichDistributionService.client.param.StoreParam;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service
public class DelivervServiceImp implements DelivervService {

    @Resource
    private DeliveryOrderClient deliveryOrderClient;

    @Override
    public Result startDelivery(StartDeliveryParam startDeliveryParam) {
        StoreParam param= BeanUtil.copyProperties(startDeliveryParam,StoreParam.class);
        Result result = deliveryOrderClient.storeAdd(param);
        return result;
    }
}
